if (this._handle == null)
return [false];
- let leaderPos, leaderSize, pos;
- let found, direction;
-
- [found, pos] = this._handle.get_position_sub(`#${labelName}`);
- if (!found)
+ const [labelFound, labelPos] = this._handle.get_position_sub(`#${labelName}`);
+ const [, labelSize] = this._handle.get_dimensions_sub(`#${labelName}`);
+ if (!labelFound)
return [false];
- [found, leaderPos] = this._handle.get_position_sub(`#${leaderName}`);
- [found, leaderSize] = this._handle.get_dimensions_sub(`#${leaderName}`);
- if (!found)
+ const [leaderFound, leaderPos] = this._handle.get_position_sub(`#${leaderName}`);
+ const [, leaderSize] = this._handle.get_dimensions_sub(`#${leaderName}`);
+ if (!leaderFound)
return [false];
- if (pos.x > leaderPos.x + leaderSize.width)
+ let direction;
+ if (labelPos.x > leaderPos.x + leaderSize.width)
direction = LTR;
else
direction = RTL;
+ let pos = {x: labelPos.x, y: labelPos.y + labelSize.height};
if (this.leftHanded) {
direction = 1 - direction;
pos.x = this._imageWidth - pos.x;